package com.myorg.search.condition;

public class NotCondition extends SearchCondition {
	private SearchCondition base = null;

	public NotCondition(SearchCondition base) {
		this.base = base;
	}

	@Override
	public String matchAndSummarize(String s) {
		String summary = base == null ? null : base.matchAndSummarize(s);

		if (summary == null) {
			int end = OFF_SET * 2 > s.length() ? s.length() : OFF_SET * 2;
			return s.substring(0, end) + (end == s.length() ? "" : "...");
		}

		return null;
	}
}
